package com.jiazhong.cloud.seata.order.controller;

import com.jiazhong.cloud.seata.order.bean.Order;
import com.jiazhong.cloud.seata.order.service.OrderService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
public class OrderController {
    @Resource
    private OrderService orderService;

    @PostMapping
    public String save(Order order) {
        return orderService.saveOrder(order) == 0 ? "失败" : "成功";
    }
}
